package com.ruoyi.system.api.factory;

import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteSysRoleService;
import com.ruoyi.system.api.domain.SysRole;

/**
 * 角色信息微服务降级处理
 * 
 * @author ruoyi
 * @date 2023-04-27
 */
@Component
public class RemoteSysRoleFallbackFactory implements FallbackFactory<RemoteSysRoleService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteSysRoleFallbackFactory.class);

    @Override
    public RemoteSysRoleService create(Throwable throwable)
    {
        log.error("角色信息服务调用失败:" + throwable.getMessage(), throwable);
        return new RemoteSysRoleService()
        {
            @Override
            public R<SysRole> selectSysRoleByRoleId(Long roleId, String source) {
                return null;
            }

            @Override
            public R<List<SysRole>> selectSysRoleList(SysRole sysRole, String source) {
                return null;
            }

            @Override
            public R<Integer> insertSysRole(SysRole sysRole, String source) {
                return null;
            }

            @Override
            public R<Integer> updateSysRole(SysRole sysRole, String source) {
                return null;
            }

            @Override
            public R<Integer> deleteSysRoleByRoleIds(Long[] roleIds, String source) {
                return null;
            }
        };

    }
}
